

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>mindspore.ops.StridedSlice &mdash; MindSpore master documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/underscore.js"></script>
        <script src="../../_static/doctools.js"></script>
        <script src="../../_static/language_data.js"></script>
        <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="mindspore.ops.TensorScatterAdd" href="mindspore.ops.TensorScatterAdd.html" />
    <link rel="prev" title="mindspore.ops.Squeeze" href="mindspore.ops.Squeeze.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../../index.html" class="icon icon-home"> MindSpore
          

          
          </a>

          
            
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">MindSpore Python API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.html">mindspore</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.common.initializer.html">mindspore.common.initializer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.communication.html">mindspore.communication</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.compression.html">mindspore.compression</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.context.html">mindspore.context</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.dataset.html">mindspore.dataset</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.dataset.audio.html">mindspore.dataset.audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.dataset.config.html">mindspore.dataset.config</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.dataset.text.html">mindspore.dataset.text</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.dataset.transforms.html">mindspore.dataset.transforms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.dataset.vision.html">mindspore.dataset.vision</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.mindrecord.html">mindspore.mindrecord</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.nn.html">mindspore.nn</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.nn.probability.html">mindspore.nn.probability</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.nn.transformer.html">mindspore.nn.transformer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.numpy.html">mindspore.numpy</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.ops.html">mindspore.ops</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.parallel.html">mindspore.parallel</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.parallel.nn.html">mindspore.parallel.nn</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.profiler.html">mindspore.profiler</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.scipy.html">mindspore.scipy</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.train.html">mindspore.train</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.boost.html">mindspore.boost</a></li>
</ul>
<p class="caption"><span class="caption-text">MindSpore C++ API</span></p>
<ul>
<li class="toctree-l1"><a class="reference external" href="https://www.mindspore.cn/lite/api/zh-CN/master/api_cpp/mindspore.html">MindSpore Lite↗</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../index.html">MindSpore</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="../mindspore.ops.html">mindspore.ops</a> &raquo;</li>
        
      <li>mindspore.ops.StridedSlice</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../_sources/api_python/ops/mindspore.ops.StridedSlice.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="mindspore-ops-stridedslice">
<h1>mindspore.ops.StridedSlice<a class="headerlink" href="#mindspore-ops-stridedslice" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="mindspore.ops.StridedSlice">
<em class="property">class </em><code class="sig-prename descclassname">mindspore.ops.</code><code class="sig-name descname">StridedSlice</code><span class="sig-paren">(</span><em class="sig-param">begin_mask=0</em>, <em class="sig-param">end_mask=0</em>, <em class="sig-param">ellipsis_mask=0</em>, <em class="sig-param">new_axis_mask=0</em>, <em class="sig-param">shrink_axis_mask=0</em><span class="sig-paren">)</span><a class="reference internal" href="../../_modules/mindspore/ops/operations/array_ops.html#StridedSlice"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#mindspore.ops.StridedSlice" title="Permalink to this definition">¶</a></dt>
<dd><p>Extracts a strided slice of a tensor.</p>
<p>Given an input tensor, this operation inserts a dimension of length 1 at the dimension.
This operation extracts a fragment of size (end-begin)/stride from the given ‘input_tensor’.
Starting from the beginning position, the fragment continues adding stride to the index until
all dimensions are not less than the ending position.</p>
<p>Given a <cite>input_x[m1, m2, …, mn]</cite>, <cite>begin</cite>, <cite>end</cite> and <cite>strides</cite> will be vectors of length n.</p>
<p>In each mask field (<cite>begin_mask</cite>, <cite>end_mask</cite>, <cite>ellipsis_mask</cite>, <cite>new_axis_mask</cite>, <cite>shrink_axis_mask</cite>)
the ith bit will correspond to the ith m.</p>
<p>If the ith bit of <cite>begin_mask</cite> is set, <cite>begin[i]</cite> is ignored and the fullest possible range in that dimension
is used instead. <cite>end_mask</cite> is analogous, except with the end range.</p>
<p>As for a 5*6*7 tensor, <cite>x[2:,:3,:]</cite> is equivalent to <cite>x[2:5,0:3,0:7]</cite>.</p>
<p>If the ith bit of <cite>ellipsis_mask</cite> is set, as many unspecified dimensions as needed will be inserted between
other dimensions. Only one non-zero bit is allowed in <cite>ellipsis_mask</cite>.</p>
<p>As for a 5*6*7*8 tensor, <cite>x[2:,…,:6]</cite> is equivalent to <cite>x[2:5,:,:,0:6]</cite>.
<cite>x[2:,…]</cite> is equivalent to <cite>x[2:5,:,:,:]</cite>.</p>
<p>If the ith bit of <cite>new_axis_mask</cite> is set, <cite>begin</cite>, <cite>end</cite> and <cite>strides</cite> are ignored and a new length 1
dimension is added at the specified position in tthe output tensor.</p>
<p>As for a 5*6*7 tensor, <cite>x[:2, newaxis, :6]</cite> will produce a tensor with shape (2, 1, 7).</p>
<p>If the ith bit of <cite>shrink_axis_mask</cite> is set, ith size shrinks the dimension by 1, taking on the value
at index <cite>begin[i]</cite>, <cite>end[i]</cite> and <cite>strides[i]</cite> are ignored.</p>
<p>As for a 5*6*7 tensor, <cite>x[:, 5, :]</cite> will result in <cite>shrink_axis_mask</cite> equal to 4.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The stride may be negative value, which causes reverse slicing.
The shape of <cite>begin</cite>, <cite>end</cite> and <cite>strides</cite> must be the same.
<cite>begin</cite> and <cite>end</cite> are zero-indexed. The element of <cite>strides</cite> must be non-zero.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>begin_mask</strong> (<a class="reference external" href="https://docs.python.org/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) – Starting index of the slice. Default: 0.</p></li>
<li><p><strong>end_mask</strong> (<a class="reference external" href="https://docs.python.org/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) – Ending index of the slice. Default: 0.</p></li>
<li><p><strong>ellipsis_mask</strong> (<a class="reference external" href="https://docs.python.org/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) – An int mask. Default: 0.</p></li>
<li><p><strong>new_axis_mask</strong> (<a class="reference external" href="https://docs.python.org/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) – An int mask. Default: 0.</p></li>
<li><p><strong>shrink_axis_mask</strong> (<a class="reference external" href="https://docs.python.org/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) – An int mask. Default: 0.</p></li>
</ul>
</dd>
</dl>
<dl>
<dt>Inputs:</dt><dd><ul class="simple">
<li><p><strong>input_x</strong> (Tensor) - The input Tensor.</p></li>
<li><p><strong>begin</strong> (tuple[int]) - A tuple which represents the location where to start. Only
constant value is allowed.</p></li>
<li><p><strong>end</strong> (tuple[int]) - A tuple or which represents the maximum location where to end.
Only constant value is allowed.</p></li>
<li><p><strong>strides</strong> (tuple[int]) - A tuple which represents the stride is continuously added
before reaching the maximum location. Only constant value is allowed.</p></li>
</ul>
</dd>
<dt>Outputs:</dt><dd><p>Tensor, The output is explained by following example.</p>
<p>In the 0th dimension, begin is 1, end is 2, and strides is 1,
because <span class="math notranslate nohighlight">\(1+1=2\geq2\)</span>, the interval is <span class="math notranslate nohighlight">\([1,2)\)</span>.
Thus, return the element with <span class="math notranslate nohighlight">\(index = 1\)</span> in 0th dimension, i.e., [[3, 3, 3], [4, 4, 4]].</p>
<p>In the 1st dimension, similarly, the interval is <span class="math notranslate nohighlight">\([0,1)\)</span>.
Based on the return value of the 0th dimension, return the element with <span class="math notranslate nohighlight">\(index = 0\)</span>,
i.e., [3, 3, 3].</p>
<p>In the 2nd dimension, similarly, the interval is <span class="math notranslate nohighlight">\([0,3)\)</span>.
Based on the return value of the 1st dimension, return the element with <span class="math notranslate nohighlight">\(index = 0,1,2\)</span>,
i.e., [3, 3, 3].</p>
<p>Finally, the output is [3, 3, 3].</p>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><ul class="simple">
<li><p><a class="reference external" href="https://docs.python.org/library/exceptions.html#TypeError" title="(in Python v3.8)"><strong>TypeError</strong></a> – If <cite>begin_mask</cite>, <cite>end_mask</cite>, <cite>ellipsis_mask</cite>, <cite>new_axis_mask</cite> or <cite>shrink_axis_mask</cite> is not an int.</p></li>
<li><p><a class="reference external" href="https://docs.python.org/library/exceptions.html#TypeError" title="(in Python v3.8)"><strong>TypeError</strong></a> – If <cite>begin</cite>, <cite>end</cite> or <cite>strides</cite> is not a tuple.</p></li>
<li><p><a class="reference external" href="https://docs.python.org/library/exceptions.html#ValueError" title="(in Python v3.8)"><strong>ValueError</strong></a> – If <cite>begin_mask</cite>, <cite>end_mask</cite>, <cite>ellipsis_mask</cite>, <cite>new_axis_mask</cite> or <cite>shrink_axis_mask</cite> is less than 0.</p></li>
</ul>
</dd>
</dl>
<dl class="simple">
<dt>Supported Platforms:</dt><dd><p><code class="docutils literal notranslate"><span class="pre">Ascend</span></code> <code class="docutils literal notranslate"><span class="pre">GPU</span></code> <code class="docutils literal notranslate"><span class="pre">CPU</span></code></p>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">input_x</span> <span class="o">=</span> <span class="n">Tensor</span><span class="p">([[[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">]],</span> <span class="p">[[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">3</span><span class="p">],</span> <span class="p">[</span><span class="mi">4</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">4</span><span class="p">]],</span>
<span class="gp">... </span>                  <span class="p">[[</span><span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="p">],</span> <span class="p">[</span><span class="mi">6</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">6</span><span class="p">]]],</span> <span class="n">mindspore</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#         [[[1. 1. 1.]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#           [2. 2. 2.]]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#          [[3. 3. 3.]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#           [4. 4. 4.]]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#          [[5. 5. 5.]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#           [6. 6. 6.]]]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># In order to visually view the multi-dimensional array, write the above as follows：</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#         [</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#             [</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#                 [1,1,1]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#                 [2,2,2]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#             ]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#             [</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#                 [3,3,3]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#                 [4,4,4]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#             ]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#             [</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#                 [5,5,5]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#                 [6,6,6]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#             ]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#         ]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">strided_slice</span> <span class="o">=</span> <span class="n">ops</span><span class="o">.</span><span class="n">StridedSlice</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">output</span> <span class="o">=</span> <span class="n">strided_slice</span><span class="p">(</span><span class="n">input_x</span><span class="p">,</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># Take this &quot; output = strided_slice(input_x, (1, 0, 2), (3, 1, 3), (1, 1, 1)) &quot; as an example,</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># start = [1, 0, 2] , end = [3, 1, 3], stride = [1, 1, 1], Find a segment of (start, end),</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># note that end is an open interval</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># To facilitate understanding, this operator can be divided into three steps:</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># Step 1: Calculation of the first dimension:</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># start = 1, end = 3, stride = 1, So can take 1st, 2nd rows, and then gets the final output at this time.</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># output_1th =</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># [</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#     [</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#         [3,3,3]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#         [4,4,4]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#     ]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#     [</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#         [5,5,5]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#         [6,6,6]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#     ]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># ]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># Step 2: Calculation of the second dimension</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># 2nd dimension, start = 0, end = 1, stride = 1. So only 0th rows can be taken, and the output at this time.</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># output_2nd =</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># [</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#     [</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#         [3,3,3]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#     ]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#     [</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#         [5,5,5]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#     ]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># ]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># Step 3: Calculation of the third dimension</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># 3nd dimension,start = 2, end = 3, stride = 1, So can take 2th cols,</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># and you get the final output at this time.</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># output_3ed =</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># [</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#     [</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#         [3]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#     ]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#     [</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#         [5]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1">#     ]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># ]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># The final output after finishing is:</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">output</span><span class="p">)</span>
<span class="go">[[[3.]]</span>
<span class="go"> [[5.]]]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c1"># another example like :</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">output</span> <span class="o">=</span> <span class="n">strided_slice</span><span class="p">(</span><span class="n">input_x</span><span class="p">,</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">output</span><span class="p">)</span>
<span class="go">[[[3. 3. 3.]]]</span>
</pre></div>
</div>
</dd></dl>

</div>


           </div>
           
          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="mindspore.ops.TensorScatterAdd.html" class="btn btn-neutral float-right" title="mindspore.ops.TensorScatterAdd" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="mindspore.ops.Squeeze.html" class="btn btn-neutral float-left" title="mindspore.ops.Squeeze" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2021, MindSpore.

    </p>
  </div>
    
    
    
    Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    
    provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>